#pragma once
#include "MObject.h"
#include "CMarioSound.h"


class Brick:public MObject
{
protected:
	float _lastX;
	float _lastY;
	shared_ptr<Sprite> _partial[4];

	Vector _v1,_v2,_p1,_p2;

	bool _willBreaked;


public:
	Brick(void);
	Brick(float x, float y, int deltaTime, LPD3DXSPRITE spriteHandler, LPDIRECT3DTEXTURE9 image);
	Brick(float x, float y, int deltaTime,int resourceName,CResourceManager *rm);
	~Brick(void);

	void Render();
	void Animate();
	void actAfterCollided(int Direction, shared_ptr<MObject> Object);
	void setStatus(int Status);


public:
	static const int STATUS_NORMAL = 0;
	static const int STATUS_SLIDE = 1;
	static const int STATUS_BREAKED = -1;
	static const int STATUS_DELETED = -100;
	static const int STATUS_SLIDE_BREAKED = -2;
};

